package cn.tedu.basic.Test1;

import sun.management.Agent;

import java.lang.annotation.Target;

//测试线程，thread
public class Test3_Thread {
    public static void main(String[] args) throws Exception {
        Thread th =new Thread();
        //Thread th1 =new Thread(Runnable, Target);
        System.out.println(th.getName());
        System.out.println(th.getId());//--tnread-0
        th.run();
        th.setName("gjhm");
        System.out.println(th.getName());
        th.start();
        th.stop();
        Thread.sleep(100);//让线程休眠100毫秒
        Thread th1 =Thread.currentThread();
        System.out.println(th1.getName());//获取正在执行的线程名称
        System.out.println(Thread.currentThread().getId());


    }
}
